package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

/**
 * <p>
 * 支付结果
 * </p>
 *
 * @author kutty
 * @since 2018-09-25
 */
@TableName("ali_pay_result")
public class PayResult extends Model<PayResult> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 渠道
     */
    private String channel;
    /**
     * 金额
     */
    private String price;
    /**
     * 商品名称
     */
    private String goods;
    /**
     * 支付结果
     */
    @TableField("pay_result")
    private String payResult;
    /**
     * 商户订单号
     */
    @TableField("trade_no")
    private String tradeNo;
    /**
     * 支付账号
     */
    private String account;
    /**
     * 时间
     */
    private Date date;
    /**
     * 支付宝交易号
     */
    @TableField("out_trade_no")
    private String outTradeNo;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getGoods() {
        return goods;
    }

    public void setGoods(String goods) {
        this.goods = goods;
    }

    public String getPayResult() {
        if(payResult.equals("1")){
            return "成功";
        }else{
            return "失败";
        }
    }

    public void setPayResult(String payResult) {
        this.payResult = payResult;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "PayResult{" +
        "id=" + id +
        ", channel=" + channel +
        ", price=" + price +
        ", goods=" + goods +
        ", payResult=" + payResult +
        ", tradeNo=" + tradeNo +
        ", account=" + account +
        ", date=" + date +
        ", outTradeNo=" + outTradeNo +
        "}";
    }
}
